<?php

namespace App\Http\Controllers;

use App\Common\Sql;

class CheckPlayerIfGame extends Base
{

    public function logic()
    {
        $row = Sql::select('t_player_info', [['id',$this->uid]], ['if_room','if_game']);
        if (count($row) == 0) {
            return $this->returnError(1, '玩家ID不存在');
        }
        $ret_data            = [];
        $ret_data['uid'] = (int)$this->uid;
        $ret_data["room_id"] = (int)$row[0]['if_room'];
        $ret_data["server_id"] = $row[0]['if_game'];
        return $this->returnData($ret_data);
    }
}